import { cmsRequest } from '@/request'

// 登录
export const fetchLogIn = (payload: { account: string; password: string }) => {
  return cmsRequest.post('/plant/system/login', payload)
}

// 游客登录
export const fetchTouristLogin = () => {
  return cmsRequest.post('/plant/system/touristLogin', { ip: '10.2.168.1' })
}

// 获取当前用户信息
export const fetchLoginInfo = (token: string) => {
  return cmsRequest.post('/plant/system/getLoginInfo', { token })
}

// 退出登录
export const fetchLogout = (token: string) => {
  return Promise.resolve({ code: 0 })
}
